let goods=[
    {
        type:0,
        id:42344,
        name:'现货 NVIDIA RTX2080 8G 256BIT/DDR6电脑独立游戏显卡',
        img:'https://img.alicdn.com/imgextra/i1/44976209/O1CN011vjldDMMiM90HmD_!!44976209.jpg_640x640q85s150_.webp',
        price:5499,
    },
    {
        type:0,
        id:132133,
        name:'技嘉GTX1080Ti Gaming OC 11G台式电脑独显VR吃鸡游戏显卡',
        img:'https://img.alicdn.com/imgextra/i3/846227090/O1CN0122FGZntT5Sp7cu4_!!846227090.jpg_640x640q85s150_.webp',
        price:3799,
    },
    {
        type:0,
        id:55654,
        name:'包邮750TI 2G吃鸡独立游戏显卡逆水寒守望逆战吃鸡LOL独显显卡',
        img:'//img.alicdn.com/imgextra/i1/438237640/TB2r3uSeQfb_uJkSne1XXbE4XXa_!!438237640.jpg_640x640q85s150_.webp',
        price:290
    },
    {
        type:1,
        id:1235479,
        name:'Cherry樱桃 MX6.0背光无冲电竞吃鸡游戏金属机械键盘RGB青轴红轴',
        img:'https://img.alicdn.com/imgextra/i4/2547957301/O1CN0123nu8xNKUsIakcl_!!2547957301.jpg_1152x1920Q50s50.jpg_.webp',
        price:699
    },
    {
        type:1,
        id:9882412,
        name:'Razer雷蛇地狱狂蛇CF绝地求生电竞电脑有线机械游戏吃鸡神器男女笔记本家用办公鼠标无后座宏',
        img:'https://img.alicdn.com/imgextra/i2/2121571337/O1CN011LkO0ieZfl8CRnZ_!!2121571337.jpg_1152x1920Q50s50.jpg_.webp',
        price:99
    },
    {
        type:3,
        id:472737,
        name:'首席玩家黑寡妇半模组铜牌额定500W宽幅静音节省台式电脑主机电源',
        img:'https://img.alicdn.com/imgextra/i1/2157626379/TB2WemCmS8YBeNkSnb4XXaevFXa_!!2157626379.jpg_1152x1920Q50s50.jpg_.webp',
        price:199
    },
    {
        type:3,
        id:2934646263,
        name:'长城电源电脑台式机 金牌700W电源服务器电源巨龙主机电源 模组',
        img:'https://img.alicdn.com/imgextra/i3/3878857395/O1CN0124UxNVXIBwmMU84_!!0-item_pic.jpg_1152x1920Q50s50.jpg_.webp',
        price:499
    },
    {
        type:5,
        id:474632,
        name:'IN WIN/迎广904Plus 中塔式钢化玻璃双面侧透台式游戏电竞大机箱',
        img:'https://img.alicdn.com/imgextra/i1/1097280647/O1CN011GeMhMq9LvE8bwp_!!1097280647.jpg_1152x1920Q50s50.jpg_.webp',
        price:1480
    },
    {
        type:9,
        id:11323587,
        name:'纯实木沙发白橡木转角沙发三人位布艺可拆洗沙发组合客厅简约家具',
        img:'https://img.alicdn.com/imgextra/i1/1030778510/O1CN012Cjcz8sCENKeXtI_!!1030778510.jpg_1152x1920Q50s50.jpg_.webp',
        price:1568
    }
];

let types=[
    {
        id:0,
        name:'显卡'
    },
    {
        id:1,
        name:'外设'
    },
    {
        id:3,
        name:'电源'
    },
    {
        id:5,
        name:'机箱'
    },
    {
        id:9,
        name:'家具'
    }
]

export default {
    getAllTypes(){
        return types
    },
    getGoodsByType(id){
        let arr=[];
        for (let item of goods)
        {
            if (item.type===id){
                arr.push(item)
            }
        }
        return arr
    },
    getGoodInfo(id){
        for (let item of goods)
        {
            if (item.id===parseInt(id))
            {
                return item
            }
        }
    }
}